
<!-- 主页面开始 -->
<div id="main" class="main" >
    <SCRIPT LANGUAGE="JavaScript">
        <!--
        function listColumn(id){
            window.location = '__URL__/index/column_id/'+id;
        }
        function selectColumn(){
            var result= PopModalWindow('__APP__/Column/treeSelect/',268,365);
            if(typeof(result) == "undefined") return;
            $('columnName').value=result[0][0];
            $('column_id').value=result[0][1];
        }
  
        //-->
    </SCRIPT>
    
    <script>
    	function addcart(strSection){
				var i;
				var ids='';
				var	colInputs = document.getElementById(strSection).getElementsByTagName("input");
				for	(i=1; i < colInputs.length; i++)
				{
					//colInputs[i].checked=colInputs[0].checked;
					if(colInputs[i].checked==true){
						//alert(colInputs[i].value);
						if(ids==''){
							ids=colInputs[i].value;
						}else {
							ids=ids+'_'+colInputs[i].value;
						}
					}
				}
				//alert(ids);
				//下面使用thinkajax
				//ajax提交待后台最后做先使用window.open 替代
				if(ids!=''){
					window.open('__URL__/add_cart/ids/'+ids);
				}else{
					alert('请先勾选要添加操作的产品');
				}
		}
		
		function removeitem(id){
			$('#'+id).remove();
		}		
    </script>
    <!-- 主体内容  -->
    <div class="content" >
        <div class="title">新建采购单 </div>
        <!--  功能操作区域  -->
        <div class="operate" >
            <!-- 查询区域 -->
            <div class="fRig">

            </div>
            <!-- 高级查询区域 -->
            <div  id="searchM" class=" none search cBoth" >
            </div>
            </FORM>
        </div>
        <!-- 功能操作区域结束 -->
        <!-- 列表显示区域  -->
        <div class="list" >
        <form name="shenggou" enctype="application/x-www-form-urlencoded" method="post"  action="__URL__/update"  class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
<table width="100%" border="0"><input type="hidden" name="id" value="{$vo.id}" />
<tr><td>采购单标题</td><td><input name="title" type="text" value="{$vo.title}"/></td><td>采购单编号</td><td><input name="number" type="text" value="{$vo.number}"/></td><td>&nbsp;</td></tr>
  <tr>
    <td>采购项目明细</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>产品名称</td>
    <td>产品编号</td>
    <td>进货价</td>
    <td>进货数量</td>
    <td>操作</td>
  </tr>
	<volist name="list" id="data">
  <tr id="{$data.id}"><input type="hidden" name="items[{$data.id}][id]"  value="{$data.id}"/>
    <td>{$data.product_name}<input type="hidden" name="items[{$data.id}][product_name]"  value="{$data.product_name}"/></td>
    <td>{$data.product_code}<input type="hidden" name="items[{$data.id}][product_code]"  value="{$data.product_code}"/></td>
    <td>{$data.price}<input type="hidden" name="items[{$data.id}][price]"  value="{$data.price}"/></td>
    <td><input type="text" name="items[{$data.id}][number]"  value="{$data.number}"/></td>
    <td><a href="javascript:void(0);" onclick="removeitem({$data.id})">移除</a></td>
  </tr>
	</volist>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="button" name="additem" id="additem" value="添加采购项目" /></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>备注</td>
      <td><textarea name="note" rows="4" id="note">{$vo.note}</textarea></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>运营部审核</td>
      <td><if condition="$vo.market_check eq 1">运营部已审核<else />运营部未审核</if></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>财务部审核</td>
      <td><if condition="$vo.financial_check eq 1">财务部已审核<else />财务部未审核</if></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>    
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交" />
      <input type="reset" name="button2" id="button2" value="重置" /></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
        </div>
        <!--  分页显示区域 -->
        <div class="page"></div>
        <!-- 列表显示区域结束 -->
    </div>
    <!-- 主体内容结束 -->
</div>
<!-- 主页面结束 -->